package com.min.monitor.config;

import com.min.monitor.os.ServerMonitor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@EnableConfigurationProperties(MonitorProperties.class)
@ComponentScan({"com.min.monitor.*"})
public class MonitorConfigure {

    @Autowired
    MonitorProperties properties;

    @Bean
    @ConditionalOnMissingBean
    ServerMonitor serverMonitor() {
        return new ServerMonitor();
    }


}
